import request from '@/utils/request'

export default {

  //1.讲师列表（条件查询分页）
  getUserListPage(current, limit, teachQuery) {
    return request({
      // url: '/eduservice/friend/pageTeacherCondition'+current +"/"+limit,
      url: `/friend/pageUserCondition/${current}/${limit}`,
      method: 'post',
      // teacherQuery条件对象，后端用RequestBody接受Json。Data表示把我们的数据用Json传递
      data: teachQuery
    })
  },
  //删除讲师
  deleteUserId(id) {
    return request({
      url: `/user/${id}`,
      method: 'delete'
    })
  },
  //屏蔽用户
  shieldFriend(friendId) {
    return request({
      url: `/friend/shield/${friendId}`,
      method: 'get'
    })
  },
  //恢复用户
  recoveryFriend(friendId) {
    return request({
      url: `/friend/unShield/${friendId}`,
      method: 'get'
    })
  },
  //添加讲师
  addFriend(friend) {
    return request({
      url: `/friend`,
      method: 'post',
      data: friend
    })
  },
  //根据id查询讲师，做用户详情回显
  getFriendInfo(id) {
    return request({
      url: `/friend/${id}`,
      method: 'get',
    })
  },
  //修改讲师
  updateFriend(friend) {
    return request({
      url: `/friend`,
      method: 'put',
      data: friend
    })
  }

}
